package com.ecjtu.stadiumre_servations.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ecjtu.stadiumre_servations.entity.domain.Booking;
import com.ecjtu.stadiumre_servations.entity.dto.BookingDTO;
import com.ecjtu.stadiumre_servations.response.Result;
import java.time.LocalDateTime;
import java.util.List;

public interface BookingService extends IService <Booking>{
    /**
     * 查询是否被预约
     */
    public boolean hasBookings(String venueId);
//    public boolean canBookings(Booking booking);
    /**
     * 创建预约
     */
    public Result createBookings(BookingDTO bookingDTO);
    /**
     * 查询所有预约
     */
    public Result bookings(Page<Booking> page);
    /**
     * 根据场馆ID查询预约
     */
    public Result selectBookingsById(Page<Booking> page, String id);
    /**
     * 根据用户ID查询预约
     */
    public Result selectBookingsByUserId(Page<Booking> page, String userId);
    /**
     * 取消预约
     */
    public Result cancelBooking(String bookingId);
    public Result selectBookingByBookingId(Page<Booking>page,String bookingId);
    /**
     * 包场
     */
    public Result bookingTheEntireVenue(BookingDTO bookingDTO,String venueName);
    public List<LocalDateTime[]> getAvailableTimeSlots(String venueId);
    public List<LocalDateTime[]> calculateAvailableTimeSlots(LocalDateTime venueStart, LocalDateTime venueEnd, List<Booking> bookings);
}
